package com.lx.design.demo.learning.liu.visitor;

import lombok.extern.slf4j.Slf4j;

/**
 * @author lx
 * @date 2021/3/1 17:30
 */
@Slf4j
public class HRDepartment extends Department{
    @Override
    public void visit(FullTimeEmployee employee) {
        int workTime = employee.getWorkTime();
      log.info("正式员工{}实际工作时间为:{}小时",employee.getName(),workTime);
      if(workTime>40){
          log.info("正式员工{}加班时间为:{}小时",employee.getName(),workTime-40);
      }else if (workTime<40){
          log.info("正式员工{}请假时间为:{}小时",employee.getName(),40-workTime);
      }
    }

    @Override
    public void visit(ParttimeEmployee employee) {

        int workTime = employee.getWorkTime();
        log.info("临时工{}实际工作时间为:{}小时",employee.getName(),workTime);
    }
}
